<?php 
$this->user = ClassRegistry::init('users.User');
$this->user->setOnlineUser($logedUser);
$onlineUsers = $this->user->onlineUsers();
?>
<div class="statictis">
	<h3><?php __("Các nhân viên đang online:")?></h3>
	<ul>
		<li><a href="#"><?php __("Tôi")?></a> (<?php echo $logedUser['username']?>)</li>
		<?php foreach ($onlineUsers as $item):?>
		
		<?php if (isset($item['username']) && $item['username'] != $logedUser['username']):
		$minutes = ceil((time() - strtotime($item['last_accessed'])) / 60);
		?>
		<li><a href="#"><?php echo $item['username']?></a> (<?php echo $minutes?> <?php __("phút trước")?>)</li>
		<?php endif;?>
		
		<?php endforeach;?>
	</ul>
</div>